<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>监控系统登录</title>
    <link href="/static/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/style.css" rel="stylesheet">
    <style>
        html, body {
            width: 100%;
            height: 100%;
            background-color: #002B5A;
        }

        .form-horizontal {
            background: #fff;
            padding-bottom: 40px;
            border-radius: 15px;
            text-align: center;
            margin-top: 100px;
        }

        .form-horizontal .heading {
            display: block;
            font-size: 35px;
            font-weight: 700;
            padding: 35px 0;
            border-bottom: 1px solid #f0f0f0;
            margin-bottom: 30px;
        }

        .form-horizontal .form-group {
            padding: 0 40px;
            margin: 0 0 25px 0;
            position: relative;
        }

        .form-horizontal .form-control {
            background: #f0f0f0;
            border: none;
            border-radius: 20px;
            box-shadow: none;
            padding: 0 20px 0 45px;
            height: 40px;
            transition: all 0.3s ease 0s;
        }

        .form-horizontal .form-control:focus {
            background: #e0e0e0;
            box-shadow: none;
            outline: 0 none;
        }

        .form-horizontal .form-group i {
            position: absolute;
            top: 12px;
            left: 60px;
            font-size: 17px;
            color: #c8c8c8;
            transition: all 0.5s ease 0s;
        }

        .form-horizontal .form-control:focus + i {
            color: #00b4ef;
        }

        .form-horizontal .fa-question-circle {
            display: inline-block;
            position: absolute;
            top: 12px;
            right: 60px;
            font-size: 20px;
            color: #808080;
            transition: all 0.5s ease 0s;
        }

        .form-horizontal .fa-question-circle:hover {
            color: #000;
        }

        .form-horizontal .main-checkbox {
            float: left;
            width: 20px;
            height: 20px;
            background: #11a3fc;
            border-radius: 50%;
            position: relative;
            margin: 5px 0 0 5px;
            border: 1px solid #11a3fc;
        }

        .form-horizontal .main-checkbox label {
            width: 20px;
            height: 20px;
            position: absolute;
            top: 0;
            left: 0;
            cursor: pointer;
        }

        .form-horizontal .main-checkbox label:after {
            content: "";
            width: 10px;
            height: 5px;
            position: absolute;
            top: 5px;
            left: 4px;
            border: 3px solid #fff;
            border-top: none;
            border-right: none;
            background: transparent;
            opacity: 0;
            -webkit-transform: rotate(-45deg);
            transform: rotate(-45deg);
        }

        .form-horizontal .main-checkbox input[type=checkbox] {
            visibility: hidden;
        }

        .form-horizontal .main-checkbox input[type=checkbox]:checked + label:after {
            opacity: 1;
        }

        .form-horizontal .text {
            float: left;
            margin-left: 7px;
            line-height: 20px;
            padding-top: 5px;
            text-transform: capitalize;
        }

        .form-horizontal .btn {
            float: right;
            font-size: 14px;
            color: #fff;
            background: #00b4ef;
            border-radius: 30px;
            padding: 10px 25px;
            border: none;
            text-transform: capitalize;
            transition: all 0.5s ease 0s;
        }

        @media only screen and (max-width: 479px) {
            .form-horizontal .form-group {
                padding: 0 25px;
            }

            .form-horizontal .form-group i {
                left: 45px;
            }

            .form-horizontal .btn {
                padding: 10px 20px;
            }
        }

        .btn-default {
            text-shadow: 0 0px 0 #fff;
            background-image: -webkit-linear-gradient(top, #fff 0, #e0e0e0 100%);
            background-image: -o-linear-gradient(top, #fff 0, #e0e0e0 100%);
            background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0));
            background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
            filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
            background-repeat: repeat-x;
            border-color: #dbdbdb;
            border-color: #ccc;
        }

        .btnsend {
            width: 71px;
            position: absolute;
            top: 0px;
            left: 443px;
            border: 0px;
            border-left: 1px solid #d6d6d6;
            height: 40px;
            line-height: 41px;
            background: #1da7d4;
            color: #fff;
            border-radius: 25px;
            cursor: pointer;
        }
    </style>
</head>

<body>

<div class="container">
    <div class="row">
        <div class="col-md-offset-3 col-md-6">
            <form class="form-horizontal" id="loginsss1">
                <span class="heading">用户登录</span>
                <div class="form-group">
                    <input type="text" class="form-control" id="account" placeholder="账号"
                           data-com.agilebits.onepassword.user-edited="yes">
                    <i class="glyphicon glyphicon-user"></i>
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" id="passwords" placeholder="密　码"
                           data-com.agilebits.onepassword.user-edited="yes">
                    <i class="glyphicon glyphicon-lock"></i>
                </div>
                <div class="form-group">
                    <a href="#" onclick="qh()"><span class="text">忘记密码 ?</span></a>
                    <button type="button" class="btn btn-default" id="btnLogin"> 登 录</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="/static/jquery.min.js"></script>
<script src="/static/libs/bootstrap/js/bootstrap.min.js"></script>
<script>

    $("#btnLogin").click(function () {
        var account = $("#account").val();
        var passwords = $("#passwords").val();

        if (account == "") {
            alert("账号不能为空!");
            return false;
        }


        if (passwords == "") {
            alert("密码不能为空!");
            return false;
        }

        $.ajax({
            type: "POST",
            url: "/loginCheck",
            data: {
                'passwd': passwords,
                'account': account
            },
            dataType: "json",
            success: function (data) {
                var status = data.status;
                if (status == 'success') {
                    window.location.href = "/home";
                } else if (status == 'fail') {
                    alert('账号不存在 or 密码错误!');
                }
            },
            error: function (e) {
                console.log('error');
            }
        });
    });

</script>
</body>

</html>
